package dp;

import java.lang.reflect.Array;
import java.util.*;

/**
 * Description:
 * Author:    Dane
 * CreateTime:2024/10/8-上午9:02
 * Since  :   1.0
 * Version:   1.0
 */
public class My01package {

    private static int values[] = {1, 5, 6, 8, 7};
    private static int weight[] = {1, 2, 5, 3, 1};
    private static int capacity = 6;

    public static int findMaxValue(int values[], int weight[], int capacity) {
        int row = values.length;
        int col = capacity;
        int currentMaxValues[][] = new int[row + 1][col + 1];
        for (int i = 0; i <= row; i++) {
            currentMaxValues[i][0] = 0;

        }
        for (int i = 0; i <= col; i++) {
//            if (i<weight[0]){
//                currentMaxValues[0][i]=0;
//            }else {
//                currentMaxValues[0][i]=values[0];
//            }
            currentMaxValues[0][i] = 0;
        }

        for (int curRow = 1; curRow <= row; curRow++) {
            for (int curCol = 1; curCol <= col; curCol++) {
                if (curCol - weight[curRow - 1] >= 0) {
                    currentMaxValues[curRow][curCol] = Math.max(currentMaxValues[curRow - 1][curCol], values[curRow - 1] + currentMaxValues[curRow - 1][curCol - weight[curRow - 1]]);
                } else {
                    currentMaxValues[curRow][curCol] = currentMaxValues[curRow - 1][curCol];
                }
            }

        }

        for (int[] rows : currentMaxValues) {
            for (int i : rows) {
                System.out.print(i + " ");
            }
            System.out.println();
        }

        return currentMaxValues[row][col];


    }

    public static int findMaxValue2(int values[], int weight[], int capacity) {
        int[] maxValues = new int[capacity + 1];
        for (int i = 1; i <= values.length; i++) {
            for (int j = capacity; j >= weight[i - 1]; j--) {

                if (j - weight[i - 1] >= 0) {
                    maxValues[j] = Math.max(maxValues[j], values[i - 1] + maxValues[j - weight[i - 1]]);
                }


            }
            for (int temp : maxValues) {
                System.out.print(temp + "");
            }
            System.out.println();

        }
        return maxValues[capacity];

    }

    public static int findTargetSumWays(int[] nums, int target) {
        int count = 0;
        for (int i : nums) {
            count += i;
        }
        int left = (count + target) / 2;
        int dp[][] = new int[nums.length][left + 1];
        dp[0][0] = 1;
        for (int i = 1; i < left + 1; i++) {
            dp[0][i] = 0;
            if (i == nums[0]) {
                dp[0][i] = 1;
            }
        }
//        int myCount = 0;
//        for (int i = 0; i < nums.length; i++) {
//            if (nums[i] == 0)
//                myCount++;
//            dp[i][0] = (int) Math.pow(2, myCount);
//        }
        for (int i = 1; i < nums.length; i++) {
            for (int j = 0; j < left + 1; j++) {
                if (j - nums[i] < 0) {
                    dp[i][j] = dp[i - 1][j];
                } else {
                    dp[i][j] = dp[i - 1][j] + dp[i - 1][j - nums[i]];
                }
            }

        }
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < left + 1; j++) {
                System.out.print(dp[i][j] + " ");

            }
            System.out.println();

        }
        return dp[nums.length - 1][left];

    }

    public static int findTargetSumWays2(int[] nums, int target) {

        int count = 0;
        for (int i : nums) {
            count += i;
        }
        int left = (count + target) / 2;
        int dp[] = new int[left + 1];
        dp[0] = 1;

//        int myCount = 0;
//        for (int i = 0; i < nums.length; i++) {
//            if (nums[i] == 0)
//                myCount++;
//            dp[i][0] = (int) Math.pow(2, myCount);
//        }
        for (int i = 0; i < nums.length; i++) {
            for (int j = left; j >= nums[i]; j--) {
                dp[j] += dp[j - nums[i]];

            }
            System.out.println(Arrays.toString(dp));

        }

        return dp[left];


    }

    public  static int change(int amount, int[] coins) {
//dp[j]+=dp[j-coins[i]]
        int dp[]=new int [amount+1];
        dp[0]=1;
        for (int i = 0; i < coins.length; i++) {
            for (int j = coins[i]; j <=amount ; j++) {
                dp[j]+=dp[j-coins[i]];
            }
            System.out.println(Arrays.toString(dp));
        }
        for (int i = 0; i < dp.length; i++) {
            System.out.print(i+" ");
        }
        return  dp[amount];

    }





    public static void main(String[] args) {
//        System.out.println(findMaxValue(values, weight, capacity));
//        System.out.println(findMaxValue2(values, weight, capacity));
//        int nums[] = {1, 1, 1, 1, 1};
//        int target = 3;
//        System.out.println(findTargetSumWays2(nums, target));
//       int amount = 5;
//       int coins[] = {1, 2, 5};
//        System.out.println(change(amount,coins));
//        Scanner in=new Scanner(System.in);
//        ArrayList<Integer> list = new ArrayList<>();
//        String s;
//       while (sc.hasNextLine()){
//           s=sc.nextLine();
//           String[] split = s.split(" ");
//           int count=0;
//           for(String string:split){
//               count+=Integer.valueOf(string);
//           }
//           System.out.println(count);
//       }
//        while (sc.hasNextInt()){
//            int a=sc.nextInt();
//            int b=sc.nextInt();
//            System.out.println(a+b);
//        }
//        while (sc.hasNextInt()){
//            list.add(sc.nextInt());
//        }
//        for (int i:list){
//            System.out.print(i+" ");
//        }


//        while(groups>0){
//             while(in.hasNextLine()){
//            int length=in.nextInt();
//            int result=0;
//            while(length>0){
//                result+=in.nextInt();
//                length--;
//            }
//            System.out.println(result);
//
//             }
//            groups--;
//        }
//        2\n
//        4 1 2 3 4\n
//        5 1 2 3 4 5\n
//        int groups=in.nextInt();
//        while(in.hasNextLine()){
//            int length=in.nextInt();
//            int result=0;
//            while(length>0){
//                result+=in.nextInt();
//                length--;
//            }
//            System.out.println(result);
//            String s="";
//

        Scanner in=new Scanner(System.in);
        int length=in.nextInt();
        List<String> result=new ArrayList<>();
        for(int i=0;i<length;i++){
            result.add(in.next());
        }

        Collections.sort(result);
        for(String s:result){
            System.out.print(s+" ");
        }
//        }
    }


}
